package com.bt.mapper;

import com.bt.entity.YddAdvimg;
import com.bt.dto.YddAdvimgDTO;
import com.bt.vo.YddAdvimgPageQueryVO;
import com.bt.vo.YddAdvimgVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description TODO
 * @Author 青
 * @Date 2023-04-30 0:38
 */
@Mapper
public interface YddAdvimgMapper {
    /**
     * 统计广告图数量
     * @return
     */
    @Select("select COUNT(*) from ydd_advimg")
    Integer countAdvimgNum();

    /**
     * 轮播图数据  advimgpos=15
     * @param i
     * @return
     */
    List<YddAdvimg> findBanner(Integer advimgpos);
    List<YddAdvimg> findBanner2(Integer advimgpos1, Integer advimgpos2);

    /**
     * 广告图详情
     * @param id
     * @return
     */
    YddAdvimgVO rowInfo(Integer id);

    /**
     * 广告图列表-分页
     * @return
     */
    Integer getCount();

    /**
     * 广告图列表-分页
     * @param start
     * @param length
     * @return
     */
    List<YddAdvimgPageQueryVO> list(Integer start, Integer length,String advimgdesc,String advimgpos);


    /**
     * 广告图修改
     * @param yddAdvimgDTO
     */
    void update(YddAdvimgDTO yddAdvimgDTO);

    /**
     * 广告图删除
     * @param id
     */
    void del(Integer id);

    /**
     *  广告图添加
     * @param yddAdvimgDTO
     */
    void add(YddAdvimgDTO yddAdvimgDTO);
}
